import type { BaseResponse_List_Room_ } from "../models/BaseResponse_List_Room_";
import type { BaseResponse_Page_Room_ } from "../models/BaseResponse_Page_Room_";
import type { BaseResponse_string_ } from "../models/BaseResponse_string_";
import type { Room } from "../models/Room";
import type { CancelablePromise } from "../core/CancelablePromise";
import { OpenAPI } from "../core/OpenAPI";
import { request as __request } from "../core/request";

export class RoomControllerService {
  /**
   * addRoom
   * @param room room
   * @returns BaseResponse_string_ OK
   * @returns any Created
   * @throws ApiError
   */
  public static addRoomUsingPost(
    room: Room
  ): CancelablePromise<BaseResponse_string_ | any> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/api/room/addroom",
      body: room,
      errors: {
        401: `Unauthorized`,
        403: `Forbidden`,
        404: `Not Found`,
      },
    });
  }

  /**
   * deleteRoom
   * @param room room
   * @returns BaseResponse_string_ OK
   * @returns any Created
   * @throws ApiError
   */
  public static deleteRoomUsingPost(
    room: Room
  ): CancelablePromise<BaseResponse_string_ | any> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/api/room/deleteroom",
      body: room,
      errors: {
        401: `Unauthorized`,
        403: `Forbidden`,
        404: `Not Found`,
      },
    });
  }

  /**
   * listPage
   * @param current current
   * @param size size
   * @returns BaseResponse_Page_Room_ OK
   * @returns any Created
   * @throws ApiError
   */
  public static listPageUsingPost1(
    current?: number,
    size?: number
  ): CancelablePromise<BaseResponse_Page_Room_ | any> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/api/room/roomList",
      query: {
        current: current,
        size: size,
      },
      errors: {
        401: `Unauthorized`,
        403: `Forbidden`,
        404: `Not Found`,
      },
    });
  }

  /**
   * searchRoom
   * @param dormNumber dormNumber
   * @returns BaseResponse_List_Room_ OK
   * @returns any Created
   * @throws ApiError
   */
  public static searchRoomUsingPost(
    dormNumber?: string
  ): CancelablePromise<BaseResponse_List_Room_ | any> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/api/room/searchroom",
      query: {
        dormNumber: dormNumber,
      },
      errors: {
        401: `Unauthorized`,
        403: `Forbidden`,
        404: `Not Found`,
      },
    });
  }

  /**
   * updateRoom
   * @param room room
   * @returns BaseResponse_string_ OK
   * @returns any Created
   * @throws ApiError
   */
  public static updateRoomUsingPost(
    room: Room
  ): CancelablePromise<BaseResponse_string_ | any> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/api/room/updateroom",
      body: room,
      errors: {
        401: `Unauthorized`,
        403: `Forbidden`,
        404: `Not Found`,
      },
    });
  }
}
